package org.visionlibrary.image.geomtric.model;


import org.visionlibrary.image.geomtric.util.Debug;

public class TRectangle extends TShape {
	private TRectangle(String name) {
		super(name);
	}

	public TRectangle(String name, Point2d a, Point2d b, Point2d c, Point2d d) {
		super(name);
		segments.add(new Vector2d(a, b));
		segments.add(new Vector2d(b, c));
		segments.add(new Vector2d(c, d));
		segments.add(new Vector2d(d, a));
	}

	@Override
	public TShape copy(String name) {
		TRectangle rcopy = new TRectangle(name);
		rcopy.segments = org.visionlibrary.image.geomtric.lines.Lines.copy(segments);
		return rcopy;
	}

	public String toString() {
		return Debug.Misc.getClassName(this.getClass()) + "("
				+ super.toString() + ");";
	}
}